#ifndef __PROGRESS_BAR_H
#define __PROGRESS_BAR_H

#define MOVERIGHT(y) printf("\033[%dC",(y))
#define MOVEDOWN(x) printf("\033[%dB", (x))
#define MOVEUP(x) printf("\033[%dA", (x))
#define MOVELEFT(y) printf("\033[%dD", (y))
#define HIDE_CURSOR() printf("\033[?25l")
#define SHOW_CURSOR() printf("\033[?25h")
#define REDUCTION "\033[0m"

struct progress_bar {
	int speed;              //速度
    int outside_color;      //外框颜色
    int inside_color;       //进度条颜色
    int length;             //长度
    int x_direction;        //以左上角为原点，向右平移的距离
    int y_direction;        //以左上角为原点，向下平移的距离
};

extern void get_terminal_param(int param_argc, char *param_argv[], struct progress_bar *progress_param);
extern void progress_bar_init(struct progress_bar *progress_data);
extern void progress_bar_run(struct progress_bar progress_data);

#endif